Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix file encoding support (UTF-8, UTF-16, with/without BOM) #2143

Merged
merged 1 commit into from
May 15, 2021

Conversation

guwirth
Copy link
Collaborator

@guwirth guwirth commented May 6, 2021

add fork of of: https://github.com/SonarSource/sslr-squid-bridge/tree/2.6.1

  • In the original version, some features were discontinued in subsequent versions, which will be further developed within the scope of this fork (close Use sslr-squid-bridge 2.7 #1484).
  • rename sslr-squid-bridge to cxx-squid-bridge
  • rename sslr-cxx-toolkit to cxx-sslr-toolkit
  • using org.sonar.cxx.squidbridge instead of org.sonar.squidbridge
  • remove from the cxx plugin not needed parts

improve AstScanner/SquidAstVisitorContext:

  • add InputFile support

improve CxxAstScanner:

  • add InputFile support

improve checks:

  • use InputFile.contents instead of File (avoid reloading of file content)
  • remove setCharset (use InputFile instead)

add smoketests:

  • UTF-8 with BOM
  • UTF-16 with BOM

This change is Reviewable

@guwirth guwirth added this to the 2.0.1 milestone May 6, 2021
@guwirth guwirth self-assigned this May 6, 2021
@guwirth guwirth force-pushed the smoketest-utf16 branch from e87a972 to 88ebb15 Compare May 6, 2021 19:41
@guwirth guwirth force-pushed the smoketest-utf16 branch 2 times, most recently from 5cc554e to 945c70a Compare May 10, 2021 09:33
@guwirth guwirth removed this from the 2.0.1 milestone May 12, 2021
@guwirth guwirth force-pushed the smoketest-utf16 branch from 70aff6e to 0441068 Compare May 14, 2021 07:30
…/2.6.1

- In the original version, some features were discontinued in subsequent versions, which will be further developed within the scope of this fork.
- rename sslr-squid-bridge to cxx-squid-bridge
- rename sslr-cxx-toolkit to cxx-sslr-toolkit
- using `org.sonar.cxx.squidbridge` instead of `org.sonar.squidbridge`
- remove from the cxx plugin not needed parts

improve AstScanner/SquidAstVisitorContext:
- add InputFile support

improve CxxAstScanner:
- add InputFile support

improve checks:
- use InputFile.contents instead of File (avoid reloading of file content)
- remove setCharset (use InputFile instead)

add smoketests:
- UTF-8 with BOM
- UTF-16 with BOM
@guwirth guwirth force-pushed the smoketest-utf16 branch from 1afeeb1 to 57a6156 Compare May 15, 2021 06:47
@ghost
Copy link

ghost commented May 15, 2021

DeepCode's analysis on #57a615 found:

  • ⚠️ 3 warnings, ℹ️ 6 minor issues. 👇
  • ✔️ 1 issue was fixed.

Top issues

Description Example fixes
Either rethrow this java.lang.InterruptedException or set the interrupted flag on the current thread with 'Thread.currentThread().interrupt()'. Otherwise the information that the current thread was interrupted will be lost. Occurrences: 🔧 Example fixes
Improve performance by introducing buffering, neither java.io.ObjectInputStream nor 1 perform buffering Occurrences: 🔧 Example fixes
The expression will always evaluate to false because both sides always hold the same value. Occurrences: 🔧 Example fixes

👉 View analysis in DeepCode’s Dashboard | Configure the bot

@guwirth guwirth added this to the 2.0.2 milestone May 15, 2021
@guwirth guwirth changed the title add Smoketest for UTF-16LE fix file encoding support (UTF-8, UTF-16, with/without BOM) May 15, 2021
@guwirth guwirth merged commit 760ceb8 into SonarOpenCommunity:master May 15, 2021
@guwirth guwirth added bug and removed enhancement labels May 15, 2021
@guwirth guwirth deleted the smoketest-utf16 branch July 26, 2022 09:00
@guwirth guwirth restored the smoketest-utf16 branch July 26, 2022 09:14
@guwirth guwirth deleted the smoketest-utf16 branch July 26, 2022 12:29
@guwirth guwirth mentioned this pull request Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

Use sslr-squid-bridge 2.7
1 participant